package com.example.lushiping2.mapper;

import com.example.lushiping2.bean.Person;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface HelloMapper {

    @Select("select * from person")
    public List<Person> getAllPerson();

    @Select("select * from person where id=#{id}")
    public Person getPerson(Integer id);

    @Insert("insert into person(`username`,`userpasswd`) values(#{username},#{userpasswd})")
    public void insertPerson(String username,String userpasswd);

    @Select("select * from person where username=#{username} and userpasswd=#{userpasswd} ")
    public Person selectUsername(String username,String userpasswd);
}
